<?php
/*
 * Created on Dec 1, 2010
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
include_once ("AddressBookDao.php");			//-- for payment
class OrdersDao
{
	private $id;

	private $languageID;
	
	private $currency;
	private $currency_value;
	private $amount;
	
	private $createdTime;
	private $modifiedTime;
	
	private $status;
	
	private $paymentMethod;
	
	private $cc_type;
	private $cc_owner;
	private $cc_number;
	private $cc_expires;

	private $comments;
	
	public function OrdersDao()
	{
	}
	
	public function setID($id)
	{
		$this->id = $id;
	}
	
	public function getID()
	{
		return $this->id;
	}
	
	public function setCCType($cc_type)
	{
		$this->cc_type = $cc_type;
	}
	
	public function getCCType()
	{
		return $this->cc_type;
	}
	
	public function setCCOwner($cc_owner)
	{
		$this->cc_owner = $cc_owner;
	}
	
	public function getCCOwner()
	{
		return $this->cc_owner;
	}
	
	public function setCCNumber($cc_number)
	{
		$this->cc_number = $cc_number;
	}
	
	public function getCCNumber()
	{
		return $this->cc_number;
	}
	
	public function setCCExpire($cc_expires)
	{
		$this->cc_expires = $cc_expires;
	}
	
	public function getCCExpire()
	{
		return $this->cc_expires;
	}
	
	public function setPaymentMethod($paymentMethod)
	{
		$this->paymentMethod = $paymentMethod;
	}
	
	public function getPaymentMethod()
	{
		return $this->paymentMethod;
	}
	
	public function setLanguageID($languageID)
	{
		$this->languageID = $languageID;
	}
	
	public function getLanguageID()
	{
		return $this->languageID;
	}
	
	public function setCurrency($currency)
	{
		$this->currency = $currency;
	}
	
	public function getCurrency()
	{
		return $this->currency;
	}
	
	public function setCurrencyValue($currency_value)
	{
		$this->currency_value = $currency_value;
	}
	
	public function getCurrencyValue()
	{
		return $this->currency_value;
	}
	
	public function setAmount($amount)
	{
		$this->amount = $amount;
	}
	
	public function getAmount()
	{
		return $this->amount;
	}
	
	public function setStatus($status)
	{
		$this->status = $status;
	}
	
	public function getStatus()
	{
		return $this->status;
	}
	
	public function setComments($comments)
	{
		$this->comments = $comments;
	}
	
	public function getComments()
	{
		return $this->comments;
	}
	
	public function getArray($customers, $customerAddress, $deliveryAddress, $billingAddress)
	{
		$data_array = array();
		
		if(is_object($customers)){
			$data_array['customers_id']            		= $customers->getID();
            $data_array['customers_name']       		= $customers->getFirstName() . ' ' . $customers->getLastName();
            $data_array['customers_street']         	= $customerAddress->getStreet();
            $data_array['customers_city']            	= $customerAddress->getCity();
            $data_array['customers_postcode']        	= $customerAddress->getZipcode();
            $data_array['customers_state']          	= $customerAddress->getState();
            $data_array['customers_country']         	= $customerAddress->getCountry();
            $data_array['customers_telephone']       	= $customers->getTelephone();
            $data_array['customers_email']           	= $customers->getEmail();
 		}
		
		if(is_object($deliveryAddress)){
            $data_array['delivery_name']       			= $deliveryAddress->getFirstName() . ' ' . $deliveryAddress->getLastName();
            $data_array['delivery_street']         		= $deliveryAddress->getStreet();
            $data_array['delivery_city']            	= $deliveryAddress->getCity();
            $data_array['delivery_postcode']        	= $deliveryAddress->getZipcode();
            $data_array['delivery_state']          		= $deliveryAddress->getState();
            $data_array['delivery_country']         	= $deliveryAddress->getCountry();
            $data_array['delivery_suburb']           	= $deliveryAddress->getSuburb();
		}
		
		if(is_object($billingAddress)){
           $data_array['billing_name']       			= $billingAddress->getFirstName() . ' ' . $billingAddress->getLastName();
            $data_array['billing_street']         		= $billingAddress->getStreet();
            $data_array['billing_city']            		= $billingAddress->getCity();
            $data_array['billing_postcode']        		= $billingAddress->getZipcode();
            $data_array['billing_state']          		= $billingAddress->getState();
            $data_array['billing_country']         		= $billingAddress->getCountry();
            $data_array['billing_suburb']           	= $billingAddress->getSuburb();
 		}
		
		
		$data_array['languageID']         	= $this->getLanguageID();
		$data_array['currency']         	= $this->currency;
        $data_array['amount']           	= $this->amount;
        $data_array['status'] 				= $this->status;
        $data_array['payment_method'] 		= $this->paymentMethod;
        
        $data_array['cc_type']       		= $this->cc_type;
        $data_array['cc_owner']           	= $this->cc_owner;
        $data_array['cc_number'] 			= $this->cc_number;
        $data_array['cc_expires'] 			= $this->cc_expires;
        
        $data_array['comments'] 			= $this->comments;
        
        $data_array['createdTime']          = 'UTC_TIMESTAMP()';
        $data_array['modifiedTime'] 		= 'UTC_TIMESTAMP()';
            
		return $data_array;
	}
	
	
}
?>
